package com.tiny.persistence.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import lombok.Data;


/**
 * The persistent class for the auth_user database table.
 * 
 */
@Data
@Entity
@Table(name="app_user")
public class AppUser implements Serializable {
	private static final long serialVersionUID = 1L;
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private int id;

	@Column(name="user_name")
	private String username;
	
	//手机号码
	@Column(name="mobile_phone")
	private String mobilePhone;
	
	//单位
	@Column(name="company")
	private String company;
	
	//单位地址
	@Column(name="address")
	private String address;
	
	//推送用的channelId
	@Column(name="pushChannelId")
	private long pushChannelId;
	
	//推送用的userId
	@Column(name="pushUserId")
	private String pushUserId;
	
	//推送用的deviceType
	@Column(name="deviceType")
	private int deviceType;

	public AppUser() {
	}
	
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		AppUser other = (AppUser) obj;
		if (id != other.id)
			return false;
		return true;
	}


	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + id;
		return result;
	}


	@Override
	public String toString() {
		return "AuthUser [id=" + id + ", username="
				+ username + ", mobilePhone=" + mobilePhone + ", company="
				+ company + ", address=" + address + "]";
	}

}